/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// pmesgwin.hpp - Popup message window class definition.
//
// Author: Kenneth G. Maxwell
//
// Copyright (c) 1997-2000 Swell Software
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef _PEGMESGWIN_
#define _PEGMESGWIN_

/*--------------------------------------------------------------------------*/

class PegMessageWindow : public PegWindow
{
    public:

        PegMessageWindow(const PegRect &Rect, PEGINT TitleStringId,
                         PEGINT MessageId = 0,
                         PEGULONG Style = MW_OK|FF_RAISED,
                         PEGINT Icon =0, PegThing *pOwner = NULL);

        PegMessageWindow(PEGINT TitleStringId,
                         PEGINT MessageId = 0,
                         PEGULONG Style = MW_OK|FF_RAISED,
                         PEGINT Icon = 0, PegThing *pOwner = NULL);

        PegMessageWindow(const PEGCHAR *Title,
                         const PEGCHAR *Message,
                         PEGULONG Style = TT_COPY|MW_OK|FF_RAISED,
                         PEGINT Icon = 0, PegThing *pOwner = NULL);

        virtual ~PegMessageWindow();

        virtual void DataSet(PEGUINT MessageId);
        virtual void DataSet(const PEGCHAR *pText);

        virtual void Draw(const PegRect &Invalid);
        virtual PEGINT Message(const PegMessage &Mesg);

        void SetTitle(PEGINT StringId)
        {
            if (mpTitle)
            {
                mpTitle->DataSet(StringId);
            }
        }

        void SetTitle(const PEGCHAR *pText)
        {
            if (mpTitle)
            {
                mpTitle->DataSet(pText);
            }
        }


    protected:
        void AddButtons(void);
        void CalcButtonWidth(void);
        void RemoveButtons(void);

        PegTitle *mpTitle;
        PegThing *mpOwner;
        PEGINT mIcon;
        PEGINT mButtonWidth;
        PEGINT mOneButtonWidth;
        PEGINT mMessageWidth;
        PEGINT mTitleWidth;
        PEGBOOL mAutoSize;
};

#endif

